{% extends 'TopxiaAdminBundle::layout.html.twig' %}

{% set menu = 'admin_course_manage' %}

{% set script_controller = 'course/import' %}

{% set tab = 'questions' %}

{% block main %}
  <br>
  <div class="well well-sm mtl">
    <form id="import-form" class="form-inline" action="" method="post" novalidate>
      <div class="form-group">
	    <input class="form-control" type="text" placeholder="导入的开始时间" name="startTime" value="">
      </div>
	  
	  <div class="form-group">
	    <input class="form-control" type="text" placeholder="导入的结束时间" name="endTime" value="">
      </div>
      
	  <button class="btn btn-primary">导入</button>
      <input type="hidden" name="_csrf_token" value="{{ csrf_token('site') }}">
    </form>
  </div>
  <table class="table table-striped table-hover" id="course-table" style="word-break:break-all;">
	<thead>
      <tr>
	    <th>编号</th>
	    <th width="30%">名称</th>
	    <th width="">连载状态</th>
	    <th>{% if setting('default.user_name') %}{{setting('default.user_name')|default('学员')}}{% else %}学员{% endif %}数</th>
	    <th>收入(元)</th>
	    <th>状态</th>
	    <th>创建者</th>
	    <th>操作</th>
      </tr>
    </thead>
    <tbody>
     {% for course in courses %}
       {% set user = users[course.userId]|default(null) %}
       {% set category = categories[course.categoryId]|default(null) %}
       {% include 'TopxiaAdminBundle:Course:tr.html.twig' %}
     {% else %}
       <tr><td colspan="20"><div class="empty">暂无课程记录</div></td></tr>
     {% endfor %}
    </tbody>
  </table>
  {{ web_macro.paginator(paginator) }}

{% endblock %}